<template>
	<view class="withdraw Column">
		<view class="withdraw_header Column">
			<view class="text">可提现金额（元）</view>
			<view class="">￥ <text class="money">200.00</text></view>
		</view>

		<view class="withdraw_header Column">
			<!-- <view class="childer Row">
				<view class="text">银行卡号</view>
				<input class="input" type="text" placeholder="请输入银行卡号..." />
			</view>
			<view class="childer Row">
				<view class="text">姓名</view>
				<input class="input" type="text" placeholder="请输入本人姓名..." />
			</view> -->
			<view class="childer Row">
				<view class="text">提现金额</view>
				<view class="Row">
					<input class="input" type="number" placeholder="请输入提现金额" data-name="money" @input="input" />
					<view class="btn"> 全部提现 </view>
				</view>
			</view>
			<view class="childer Row">
				<view class="text">提现时间</view>
				<view class="paratexts">早上8:30—下午8:30</view>
			</view>
			<view class="childer Row">
				<view class="text">手续费</view>
				<view class="">0</view>
			</view>
			<view class="childer Row">
				<view class="text">到账金额</view>
				<view class="">0</view>
			</view>
		</view>

		<view class="withdraw_submit" @click="confirm">提交</view>

		<view class="withdraw_detail Row" @click="recordOfContract">提现记录</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				money: ""
			};
		},
		methods: {
			input(e) {
				let Val = e.detail.value.trim();
				this.money = Val;
			},
			confirm() {
				let that = this;
				if (that.money == "") {
					uni.$u.toast("未填写提现金额")
					return false;
				}
				uni.$u.http.post('/kafu.dt_user/withdraw', {
					money: that.money
				}).then(res => {
					if (res.code == 0) {
						uni.$u.toast(res.msg);
						return false;
					}
					uni.$u.toast("提交成功");
					setTimeout(function() {
						that.$router.go(0);
					}, 2000)
				}).catch(err => console.log(err.msg))
			},
			recordOfContract() {
				uni.navigateTo({
					url: "./Signed/recordOfContract/recordOfContract"
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #F8F8F8;
	}

	.text {
		color: #7E7E9A;
	}

	.input {
		width: 260rpx;
		text-align: center;
	}

	.paratexts {
		font-size: 30rpx;
	}

	.withdraw {
		width: 100%;

		&_header {
			width: 92%;
			background-color: #fff;
			padding: 30rpx;
			margin-top: 20rpx;

			.money {
				font-size: 48rpx;
			}

			.childer {
				justify-content: space-between;
				padding: 20rpx 0;

				.btn {
					color: #0384FC;
					font-size: 28rpx;
					border-radius: 8rpx;
					border: 2rpx solid #0384FC;
					padding: 8rpx 12rpx;
					margin-left: 20rpx;
				}
			}

			// .childer:nth-child(2) {
			// 	border-bottom: 2rpx solid #e8e8e8;
			// }
		}

		&_submit {
			width: 90%;
			display: flex;
			justify-content: center;
			align-items: center;
			color: #fff;
			background-color: #0056FF;
			// background-color: #C2DDF8;
			// background: linear-gradient(to bottom, #0384FC, #0E3B99);
			border-radius: 60rpx;
			padding: 20rpx 0;
			margin: 40rpx auto;
		}

		&_detail {
			width: 94%;
			color: #7E7E9A;
			font-size: 30rpx;
			justify-content: flex-end;
		}
	}
</style>